/*
 * This class was found at
 * http://www.kilobolt.com/day-5-the-android-game-framework-part-i.html
 * in an article by James Cho.  According to Cho the code was originally from
 * Beginning Android Games by Mario Zechner and under the Apache 2.0 license.
 * See http://www.apache.org/licenses/LICENSE-2.0.txt
 * 
 * The only modification made was preceding the name of the class with a K.
 */

package caddey.jonathan.gameframeworkandroidimplementation;

import java.util.List;

import android.content.Context;
import android.view.View;
import framework.KInput;



public class KAndroidInput implements KInput {    
    KTouchHandler touchHandler;

    public KAndroidInput(Context context, View view, float scaleX, float scaleY) {
        //if(Integer.parseInt(VERSION.SDK) < 5)
            touchHandler = new KSingleTouchHandler(view, scaleX, scaleY);
        //else
            //touchHandler = new MultiTouchHandler(view, scaleX, scaleY);        
    }


    @Override
    public boolean isTouchDown(int pointer) {
        return touchHandler.isTouchDown(pointer);
    }

    @Override
    public int getTouchX(int pointer) {
        return touchHandler.getTouchX(pointer);
    }

    @Override
    public int getTouchY(int pointer) {
        return touchHandler.getTouchY(pointer);
    }



    @Override
    public List<TouchEvent> getTouchEvents() {
        return touchHandler.getTouchEvents();
    }
   
}